<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="" />
    <meta name="author" content="" />
    <link rel="icon" href="img/asset-favicon.ico" />
    <title>社交-我的主页</title>
    <!-- 页面 css js -->
    <link rel="stylesheet" type="text/css" href="plugins/normalize-css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="plugins/yui/cssgrids-min.css" />
    <link rel="stylesheet" type="text/css" href="plugins/sui/sui.min.css" />
    <link rel="stylesheet" type="text/css" href="plugins/sui/sui-append.min.css" />
    <link rel="stylesheet" type="text/css" href="plugins/font-awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="css/widget-base.css" />
    <link rel="stylesheet" type="text/css" href="css/widget-head-foot.css" />
    <link rel="stylesheet" type="text/css" href="css/page-sj-person-homepage.css" />
</head>
<body>
<div  id="app">
    <div class="wrapper">
        <!--引用组件-->
        <!--头部导航-->
        <header>
            <div class="sui-navbar">
                <div class="navbar-inner">
                    <a href="index-logined.html" class="sui-brand"><img src="img/asset-logo-black.png" alt="社交" /></a>
                    <ul class="sui-nav">
                        <li class="active"><a href="headline-logined.html">头条</a></li>
                        <li><a href="./qa-logined.html">问答</a></li>
                        <li><a href="./activity-index.html">活动</a></li>
                        <li><a href="./makeFriends-index.html">交友</a></li>
                        <li><a href="./spit-index.html">吐槽</a></li>
                        <li><a href="recruit-index.html">招聘</a></li>
                    </ul>
                    <form class="sui-form sui-form pull-left">
                        <input type="text" placeholder="输入关键词..." />
                        <span class="btn-search fa fa-search"></span>
                    </form>
                    <div class="sui-nav pull-right info">
                        <li><a href="./other-notice.html" target="_blank" class="notice">通知</a></li>
                        <li><a href="./person-homepage.html" target="_blank" class="homego"><img :src='image' alt="用户头像" style="height: 50px;width: 50px;"/></a></li>
                        <li><a href="javascript:" @click="logout()">退出登陆</a></li>
                    </div>
                </div>
            </div>
        </header>
    </div>

    <div class="myhome-personinfo" style="background-color:#AEDD81">
        <div class="wrapper">
            <div class="person-baseinfo">
                <!--头像信息-->
                <div class="photo">
                    <img :src='image' alt="" class="person" style="display: block"/>
                    <div><a @click="upload=true" href="javascript:" style="margin-left: 40px">更换头像</a></div>
                    <div class="share">
                        <span><img src="img/asset-QQ.png" alt="" width="34" height="28" /></span>
                        <span><img src="img/asset-weixin.png" alt="" width="28" height="28" /></span>
                        <span><img src="img/asset-weibo.png" alt="" width="28" height="28" /></span>
                    </div>
                </div>
                <!--文字信息-->
                <div class="info">
                    <h1>{{username}}<span class="allinfo"><a href="person-myfile.html" target="_blank">查看完整档案</a></span></h1>
                    <ul class="fill">
                        <li>
                            <i class="fa fa-map-marker" aria-hidden="true"></i>
                            <span class="edit-item" @click='check_city()'>{{ city }}</span>
                            <form v-show='error_city' action="" class="sui-form form-inline" @submit.prevent="on_submit_one()">
                                <input v-model='city' type="text" placeholder="现居城市" />
                                <button  type="submit" class="sui-btn btn-danger save-btn">保存</button>
                            </form>
                        </li>
                        <li> <i class="fa fa-graduation-cap" aria-hidden="true"></i> <span class="edit-item" @click='check_school()'>{{ message }}</span>
                            <form v-show='error_school' action="" class="sui-form form-inline" @submit.prevent="on_submit_two()">
                                <input v-model="school" type="text" placeholder="院校名称" />
                                <input v-model="specialities" type="text" placeholder="所学专业" />
                                <button class="sui-btn btn-danger save-btn">保存</button>
                            </form> </li>
                        <li> <i class="fa fa-shopping-bag" aria-hidden="true"></i> <span class="edit-item" @click="check_company()"> {{ message_company }}</span>
                            <form v-show='error_company' action="" class="sui-form form-inline" @submit.prevent="on_submit_three()">
                                <input v-model='company' type="text" placeholder="公司/组织名称" />
                                <input v-model='position' type="text" placeholder="职位头衔" />
                                <button class="sui-btn btn-danger save-btn">保存</button>
                            </form> </li>
                        <li> <i class="fa fa-link" aria-hidden="true"></i> <span class="edit-item" @click="check_web">{{ website }}</span>
                            <form v-show="error_web" action="" class="sui-form form-inline" @submit.prevent="on_submit_four">
                                <input v-model='website' type="text" placeholder="个人网站" />
                                <button class="sui-btn btn-danger save-btn">保存</button>
                            </form> </li>
                    </ul>
                </div>
            </div>
            <!--右侧编辑-->
            <div class="edit-info">
                <h4>个人简介<span class="addedit" @click="check_intro()"><img src="img/widget-edit.png" width="12" height="12" />编辑</span></h4>
                <div class="info-box">
                    <div v-show='errors_intro' class="edit-intro">
                        {{ intro }}
                    </div>
                    <div v-show='error_intro'>
                        <textarea cols="25" rows="7" class="edit-intro" v-model="intro"></textarea>
                        <button @click="set_intro">保存</button>
                    </div>

                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>

    <!--两列布局-->
    <div class="wrapper  myhome">
        <div class="left-list">
            <div class="myhome-list">
                <ul class="home-list">
                    <li class="active"><a href="./person-homepage.html">我的主页</a></li>
                    <li><a href="./person-myanswer.html">我的回答</a></li>
                    <li><a href="./person-myquestion.html">我的提问</a></li>
                    <li><a href="person-myshare.html">我的分享</a></li>
                </ul>
                <ul class="home-list bottom">
                    <li><a href="./person-dynamic.html">个人动态</a></li>
                    <li><a href="person-myfocus.html">我的关注</a></li>
                    <li><a href="person-mycollect.html">我的收藏</a></li>
                    <li><a href="person-myreaded.html">浏览记录</a></li>
                    <li><a href="person-account.html">账户设置</a></li>
                </ul>
            </div>
        </div>
        <div class="right-content">
            <div class="home-content">
                <ul class="sui-nav nav-tabs nav-large">
                    <li v-bind:class="cls1"><a href="#one" data-toggle="tab" @click="my_questions()">我的提问</a></li>
                    <li v-bind:class="cls2"><a href="#two" data-toggle="tab" @click="my_answers()">我的回答</a></li>
                </ul>
                <div class="tab-content tab-wraped">
                    <div id="one" class="tab-pane active" v-show="error_question">
                        <ul class="question-list" v-for="question in questions">
                            <li> <span class="fl good"><span class="num">{{question.like_count}}</span> 有用</span> <span class="title"><a href="#">{{ question.title }}</a></span> <span class="fr date">4月6日</span> <span class="clearfix"></span> </li>
                        </ul>
                    </div>
                    <div id="two" v-show="error_answer">
                        <ul class="question-list" v-for="answers in answerses">
                            <li> <span class="fl good"><span class="num">{{answers.like_count}}</span> 有用</span> <span class="title"><a href="#">{{ answers.title }}</a></span> <span class="fr date">4月6日</span> <span class="clearfix"></span> </li>
                        </ul>
                    </div>
                </div>
                <div class="activities">
                    <h4 class="tit"><span>我的动态</span></h4>
                    <ul class="activities-content">
                        <li>
                            <div class="index-title">
                                <span class="author">本杰明</span>
                                <span class="operate">关注了标签</span> &middot;
                                <span class="time">3小时前</span>
                            </div>
                            <div class="guanzhuname">
                                <span class="tag">php</span>
                                <span class="tagnum">100</span> 关注
                            </div>
                            <div class="intro">
                                PHP，是英文超文本预处理语言 Hypertext Preprocessor 的缩写。PHP 是一种开源的通用计算机脚本语言，尤其适用于网络开发并可嵌入HTML中使用。PHP 的语法借鉴吸收C语言、Java和Perl等流行计算机语言的特点，易于一般程序员学习。
                            </div> </li>
                        <li>
                            <div class="index-title">
                                <span class="author">本杰明</span>
                                <span class="operate">回答了问题</span> &middot;
                                <span class="time">3小时前</span>
                            </div>
                            <div class="question">
                                <p class="title">网页链接如何直接打开微信，并进入公众号关注页面</p>
                                <p class="content">现在针对这个微信是屏蔽的，你可以选择通过连接到一个其他的公众号文章中进行关注。</p>
                            </div>
                            <div class="qa-num">
                                <span>关注<i>1</i></span>
                                <span>回答<i>2</i></span>
                            </div> </li>
                        <li>
                            <div class="index-title">
                                <span class="author">本杰明</span>
                                <span class="operate">收藏了文章</span> &middot;
                                <span class="time">3小时前</span>
                            </div>
                            <div class="question">
                                <p class="title">网页链接如何直接打开微信，并进入公众号关注页面</p>
                            </div>
                            <div class="qa-num">
                                <span><a href="#">http://baidu.com</a></span>
                            </div> </li>
                        <li>
                            <div class="index-title">
                                <span class="author">本杰明</span>
                                <span class="operate">收藏了文章</span> &middot;
                                <span class="time">3小时前</span>
                            </div>
                            <div class="question">
                                <p class="title">网页链接如何直接打开微信，并进入公众号关注页面</p>
                            </div>
                            <div class="qa-num">
                                <span><a href="#">http://baidu.com</a></span>
                            </div> </li>
                        <li>
                            <div class="index-title">
                                <span class="author">本杰明</span>
                                <span class="operate">回答了问题</span> &middot;
                                <span class="time">3小时前</span>
                            </div>
                            <div class="question">
                                <p class="title">网页链接如何直接打开微信，并进入公众号关注页面</p>
                                <p class="content">现在针对这个微信是屏蔽的，你可以选择通过连接到一个其他的公众号文章中进行关注。</p>
                            </div>
                            <div class="qa-num">
                                <span>关注<i>1</i></span>
                                <span>回答<i>2</i></span>
                            </div> </li>

                    </ul>
                </div>
            </div>
        </div>

    </div>
    <div class="clearfix"></div>

    <div v-show="upload" style="width: 500px; height: 350px; background: #cccccc; position: absolute; left: 600px; top: 20px; border-radius:15px; padding: 25px">
        <span style="float: right"><a href="javascript:" @click="upload=false">X</a></span>
        <h1 style="text-align: center">请上传新的头像</h1>
        <div style="margin: auto; width:150px; margin-top:75px;">

            <img :src='image' alt="" style="width: 150px; height: 150px; display: block;" id="preview"/>

            <form action="javascript:" ref="form" enctype="multipart/form-data" @submit="submit()">
                <input type="file" name="file" onchange="imgPreview(this)" v-model="files">
                <button type="submit">确定</button>
                <input @click="upload=false" type="button" value="取消">
            </form>

            <script type="text/javascript">
                function imgPreview(fileDom){
                    //判断是否支持FileReader
                    if (window.FileReader) {
                        var reader = new FileReader();
                    } else {
                        alert("您的设备不支持图片预览功能，如需该功能请升级您的设备！");
                    }

                    //获取文件
                    var file = fileDom.files[0];
                    var imageType = /^image\//;
                    //是否是图片
                    if (!imageType.test(file.type)) {
                        alert("请选择图片！");
                        return;
                    }
                    //读取完成
                    reader.onload = function(e) {
                        //获取图片dom
                        var img = document.getElementById("preview");
                        //图片路径设置为读取的图片
                        img.src = e.target.result;
                    };
                    reader.readAsDataURL(file);
                }
            </script>
        </div>
    </div>



</div>
<div class="footer">
    <div class="wrapper">
        <div class="footer-bottom">
            <div class="link">
                <dl>
                    <dt>
                        网站相关
                    </dt>
                    <dd>
                        关于我们
                    </dd>
                    <dd>
                        服务条款
                    </dd>
                    <dd>
                        帮助中心
                    </dd>
                    <dd>
                        编辑器语法
                    </dd>
                </dl>
                <dl>
                    <dt>
                        常用链接
                    </dt>
                    <dd>
                        传智播客
                    </dd>
                    <dd>
                        传智论坛
                    </dd>
                </dl>
                <dl>
                    <dt>
                        联系我们
                    </dt>
                    <dd>
                        联系我们
                    </dd>
                    <dd>
                        加入我们
                    </dd>
                    <dd>
                        建议反馈
                    </dd>
                </dl>
                <dl>
                    <dt>
                        关注我们
                    </dt>
                    <dd>
                        微博
                    </dd>
                    <dd>
                        twitter
                    </dd>
                </dl>
                <div class="xuke">
                    <h3>内容许可</h3>
                    <p>除特别说明外，用户内容均采用知识共享署名-非商业性使用-禁止演绎4.0 国际许可协议 (CC BY-NC-ND 4.0) 进行许可</p>
                    <p>本站由 传智研究院 提供更新服务</p>
                </div>
            </div>
            <p class="Copyright">Copyright &copy; 2017 传智问答社区 当前版本 0.0.1</p>
        </div>
    </div>
</div>

</body>
</html>

<script src="./js/vue-2.5.16.js"></script>
<script src="./js/base.js"></script>
<script src="./js/axios-0.18.0.min.js"></script>
<script src="./js/person-homepage.js"></script>